package com.example.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class Hello {
    @RequestMapping("/hello")
    public String hello(Model model){
        // 封装数据
        model.addAttribute("msg","Hello SpringMVC");
        return "hello";
    }

    @ResponseBody
    @RequestMapping("/aaa")
    public String aaa(){
        return "aaa";
    }
}
